<%@ page import="raojt.day0109.tour.dao.TourDao" %>
<%@ page import="raojt.day0109.tour.dao.impl.TourDaoImpl" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="raojt.day0109.tour.entity.TourRoute" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: 22770
  Date: 2023/1/9
  Time: 20:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>青游旅行社服务平台</title>
    <script type="text/javascript" src="../../../js/raojt/travel/jquery-3.6.3.js"></script>
    <link type="text/css" rel="stylesheet" href="../../../css/raojt/travel/index.css"/>
    <script type="text/javascript" src="../../../js/raojt/travel/index.js"></script>

    <%
        TourDao tourDao = new TourDaoImpl();
        Map<String, Object> map = new HashMap<>();
        List<TourRoute> tourRouteList = tourDao.selectTourRouteAll(map);
    %>
</head>

<body>
<div class="population">
    <div class="top">
        <h1>青游旅行社服务平台</h1>
    </div>
    <div class="middle">
        <div class="top">
            <div class="addButton">
                <button onclick="location.href='addTour.jsp'">添加</button>
            </div>
        </div>
        <div class="middle">
            <ul>
                <li>旅游路线名称</li>
                <li>类型</li>
                <li>价格</li>
                <li>咨询电话</li>
                <li>咨询人</li>
                <li>创建日期</li>
                <li>操作</li>
            </ul>
        </div>
        <div class="last">
            <form method="post" action="deleteController.jsp">
                <%
                    for (int i = 0; i < tourRouteList.size(); i++) {
                        String type = tourRouteList.get(i).getType();
                        if ("1".equals(type)) {
                            type = "自由行";
                        } else {
                            type = "纯玩团";
                        }
                %>
                <ul>
                    <li name="name"><%=tourRouteList.get(i).getName()%>
                    </li>
                    <li class="type"><%=type%>
                    </li>
                    <li><%=tourRouteList.get(i).getPrice()%>
                    </li>
                    <li><%=tourRouteList.get(i).getPhone()%>
                    </li>
                    <li><%=tourRouteList.get(i).getUser()%>
                    </li>
                    <li><%=tourRouteList.get(i).getCreateTime()%>
                    </li>
                    <li>
                        <a href="javascript:void(0);">详情</a>&nbsp;&nbsp;
                        <a href="deleteController.jsp?name=<%=tourRouteList.get(i).getName()%>" class="del">删除</a>
                    </li>
                </ul>
                <%
                    }
                %>
            </form>
        </div>
    </div>
</div>
</body>
</html>
